-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New preprocessor #2636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New preprocessor #2636
Conversation
Forgot to say: this PR is based on #2568 so it also carries the last avr toolchain available |
No joy on windows :( |
Run on linux, mac and windows with no problems |
With this fix, I still have errors with the DUE HardwareSerial write(), print(), println(), and flush() methods. The code below produces an intermittent truncation error, which has been included below the code sample. Multiple delays have been inserted in order to try and circumvent this particular problem.
The error: 1 Please Enter Way+4: 4,4 As you can see, lines 4 and 11 contain erroneous data. Line 4 should look like line 2, and Line 11 should read, "Please Enter The Number Of Waypoints You Desire(NOT TO EXCEED 20): 0". Thoughts? |
@TeamSouth I think your issue has nothing to do with the preprocessor. Please try both 1.6.0 and nightly versions of the IDE and open a separate issue with the whole sketch and libraries |
Love reported at #2630 (comment) |
I've tested the macosx-java-latest version, tried to compile the Blink sample. Getting the following error from the linker:
It seems that the Blink.cpp is empty:
The I suppose this Full compile log:
|
Okay, digged a bit further and it seems that
I'm on OS X 10.10. Probably would be nice to handle the non-zero return code from edit: attaching otool output:
edit 2: probably related: http://stackoverflow.com/a/23533868 |
Unfortunately coan exists with non-zero exit codes even if it just prints a warning, so exit code is not reliable |
Oops, I was using an older build from #2630 (comment). |
Ah excellent. More love! |
Love from #1971 (comment) |
…tructs but we still don't deal with them
…ere the first function is defined and place the prototypes right before. Coan will replace excluded code with empty lines instead of removing them: this makes it easier to map preprocessed code with the original one
… are wrong though
…ts loaded first and children platform.txt can override its key value pairs
…mple when you have defined a custom hardware packge (in your own sketchbook/hardware folder) and you have not defined a platform.txt because your build.core is arduino:something
(defined in IDE/hardware/platform.txt) is used as a base for custom hardware (defined in SKETCHBOOK/hardware/platform.txt)
Replaced by #2729 because of issues with my fork :( |
This PR introduces a new preprocessor, based on two binary tools: coan and (a modified version of) ctags
coan is use to resolve #define #ifdef et al, producing a clean sketch.
If your sketch has
the resulting sketch will be
ctags is used to collect function definitions and to generate their prototypes. If a prototype is already defined, it will not be generated.
If your sketch has
the resulting sketch will be
coan and ctags are defined in a parent platform.txt (currently located in IDE_FOLDER/hardware)
A new mechanism for loading platform.txt allows to group key value pairs common to multiple platforms or packages into separate files. Those pairs will be merged into children platform.txt. The key value pair nearest to boards.txt wins and overwrites pairs with the same key.
An example is IDE_FOLDER/hardware/arduino/sam/platform.txt, where coan command line is customized with sam specific parameters.
This keep users that have defined a 3rd party platform based on the avr one from having to update it adding the new tools definitions, and lowers the burden of those that started from the sam one.
This PR fixes lots of issues: see Component: PreprocessorThe Arduino sketch preprocessor converts .ino files into C++ code before compilation